using UnityEngine;
using System.Collections;

public class VictoryScript : MonoBehaviour {

	public Texture2D victoryScreen;
	public Texture2D black;

	Texture2D activeScreen;

	// Use this for initialization
	void Start () {
		activeScreen = black;
	}
	
	// Update is called once per frame
	void Update () {
		if (Time.time < 0.8f)
			activeScreen = black;
		else if (Time.time < 1.0f)
			activeScreen = victoryScreen;
		else if (Time.time < 1.4f)
			activeScreen = black;
		else if (Time.time < 1.6f)
			activeScreen = victoryScreen;
		else if (Time.time < 2.2f)
			activeScreen = black;
		else if (Time.time > 2.7f)
			activeScreen = victoryScreen;

		audio.volume *= 0.998f;
	}

	void OnGUI()
	{
		GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), activeScreen);
	}
}
